package com.surge;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SurgeMain {

	private static ApplicationContext ctx;

	public static void main(String[] args) {
		
		
		// 创建 Spring 的 IOC 容器
		ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
		
		/*
		 * 1、静态工厂 
		 */
		Car car =  (Car) ctx.getBean("carFactory");
		
		System.out.println(car);

		
		/*
		 * 1、实例工厂 
		 */
		Car car2 =  (Car) ctx.getBean("car");
		
		System.out.println(car2);
		
	}

}
